<script setup lang="ts">
const props = defineProps({
  modelValue: {
    type: Boolean,
    default: false,
  },
})
let value = props.modelValue
</script>

<template>
  <el-dialog
    class="js-dialog"
    v-bind="$attrs"
    v-model="value"
    :append-to-body="false"
    destroy-on-close
    title=""
    width="80%"
  >
    <template #default>
      <div class="custom-dialog">
        <slot name="title">
          <div v-if="$attrs.title" class="custom-dialog-title">
            {{ $attrs.title }}
          </div>
        </slot>
        <slot name="default">
          <div v-if="$attrs.content" class="custom-dialog-content">
            {{ $attrs.content }}
          </div>
        </slot>
        <div class="custom-dialog-footer">
          <slot name="footer"> </slot>
        </div>
      </div>
    </template>
  </el-dialog>
</template>

<style lang="scss" scoped>
.custom-dialog {
  padding: 20px 0px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  gap: 20px;
  &-title {
    font-size: 18px;
    display: flex;
    justify-content: start;
    width: 100%;
    padding-left: 20px;
  }
  &-content {
    padding: 10px 20px;
  }
  &-footer {
    display: flex;
    justify-content: end;
    width: 100%;
  }
}
</style>
